# -*- coding:utf-8 -*-
"""
@Time : 2025/02/01 15: PM
@Author: xiaomi
@Des: 用户管理
"""
import os
import time

from api.common.common import write_access_log
from api.common.sms import check_code
from core.Response import success, fail, res_antd
from models.base import Member
from schemas.backend import member
from core.Utils import en_password, check_password, random_str
from core.Auth import create_access_token, check_permissions
from fastapi import Request, Query, APIRouter, Security, File, UploadFile
from config import settings
from typing import List
from tortoise.expressions import F

from schemas.backend.user import UpdateUserInfo, ModifyMobile

router = APIRouter()

@router.post("", summary="添加会员")
async def create_member(post: member.CreateMember):
    """
    创建会员
    :param post: CreateMember
    :return:
    """
    result = await Member.create(name=post.name, email=post.email)

    if not result:
        return fail(msg="创建失败!")
    return success(msg="创建成功!", data=result)